#include <iostream>
#include <vector>
#include <list>
#include <algorithm>

using namespace std;

/**
  *插入迭代器
  *back_inserter --- push_back
  *front_inserter --- push_front
  *inserter --- insert
  */


int main(int argc, char *argv[])
{
    vector<int> vi{1, 2, 3, 4, 5, 5, 6};
    list<int> li;

    unique_copy(vi.begin(), vi.end(), back_inserter(li));

    for (auto v : li)
    {
        cout << v << endl;
    }
    return 0;
}

